<?php 
class Zend_View_Helper_Widget_CarAddSwitcher extends Zend_View_Helper_Abstract{
    public function widget_CarAddSwitcher($selectedCategory = 0){
        $categoryManager = new \Managers\Category();
        $category_rewrite='';
        $categories = $categoryManager->getEnabled(1);
        if($selectedCategory){
            $categoryManager = new Managers\Category();
            $category = $categoryManager->get($selectedCategory,1);
            if(count($category))$category_rewrite = $category[0]['rewrite'];
        }
        return $this->view->partial('partials/car/car-add-switcher.phtml', array('categories'=>$categories, 'selected'=>$selectedCategory, 'category'=>$category_rewrite));
    }
}